package com.fjwt.gz.proxy.ctrl.common;

import cn.hutool.json.JSONUtil;
import com.fjwt.gz.core.model.ApiRes;
import com.fjwt.gz.core.model.DBApiMapConfig;
import com.fjwt.gz.proxy.ctrl.CommonCtrl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 地图相关
 * @Author: Will
 * @Date: 2024-01-03
 * @Version: 1.0
 */
@Slf4j
@RestController
@RequestMapping("/api/map")
public class MapController extends CommonCtrl {

    /**
     * 获取地图配置参数
     */
    @GetMapping("/mapConfig")
    public ApiRes getMapConfig() {
        DBApiMapConfig apiMapConfig = sysConfigService.getDBApiMapConfig();
        log.info("获取地图配置,请求地址：/api/map/mapConfig，请求参数:{}", JSONUtil.toJsonStr(apiMapConfig));
        return ApiRes.ok(apiMapConfig);
    }
}
